package neptune.manager.connector;



public class Test 
{
	public static void main(String[] args)
	{
		try 
		{
			// Duplico e configuro il template
			String vmId="Prova3";
			String ip= new String("192.168.0.68");
			String netmask=new String("255.255.255.0");
			String gateway=new String("192.168.74.198");
			String[] macAddress=new String[2];
			macAddress[0]="00:16:3e:5b:9a:42";
			macAddress[1]="00:18:de:79:5a:b8";
			
			String sourceTemplatePath="/NeptuneVMs/Templates/debian4.tpl/debian4.tpl.img";
			String destTemplatePath="/NeptuneVMs/Templates/debian4.tpl/debian4.tplCOPY3.img";
			int memory = 524288;
			String pathScriptClone="/home/antonio/Desktop/emuPlugin/scripts/clone.sh";
			
			LibvirtXenConnector ha = new LibvirtXenConnector("192.168.1.18",22,"antoxps");
			ha.createVM(vmId, ip,netmask,gateway, macAddress, sourceTemplatePath, destTemplatePath, LibvirtXenConnector.DIST_DEBIAN,
					memory, pathScriptClone, "/sbin", "/sbin", null);
			/*
			String[][] domini = ha.getAllDomains();
			int numRighe=domini.length;
			for(int i=0 ; i<numRighe ; i++)
			{
				System.out.print("id="+domini[i][0] );
				System.out.print("\tnome="+domini[i][1] );
				System.out.print("\tstato="+domini[i][2] );
				System.out.println("\tmem="+domini[i][3] );	
			}
			*/
			
			ha.closeConnection();
		}
		catch (ConnectorException e) 
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
